package mymyoux.io.sockets.clients.clientsClasses
{
	import mymyoux.utils.Hash;
	import mymyoux.io.sockets.clients.BinarySocket;
	public class MRoomsArray
	{
		protected var _rooms:Hash;
		public function MRoomsArray()
		{
			_rooms = new Hash();
		}
		public function get(name:String):MRoom
		{
			var room:MRoom;
			if(!_rooms.has(name))
			{
				socket = new BinarySocket();
				socket.host = host;
				socket.port = port;
				_sockets.put(keyMaker(host, port), socket);
			}else
			{
				socket = _sockets.get(keyMaker(host, port)) as BinarySocket;
			}
			return socket;
		}
		public function put(host:String, port:uint, socket:BinarySocket):void
		{
			_sockets.put(keyMaker(host, port), socket);
		}
		protected function keyMaker(host:String, port:uint):String
		{
			return host+":"+port;
		}
	}
}